package com.jt.mapper;

import com.jt.pojo.ItemCat;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;

public interface ItemCatMapper {

    @Select("select *from item_cat where parent_id=#{parentId}")
    List<ItemCat> findParentId(Integer level);

   //开关
    @Update("update Item_cat set  status=#{status},updated=#{updated} where id=#{id}")
    void SelectStatus(ItemCat itemCat);

    //@Insert("insert into Item_cat set values(name=#{name},parentId=#{parenId},level=#{level});")
    void userItemCat(ItemCat itemCat);

    @Select("select * from item_cat")
    List<ItemCat> findItemCatList();

    void updateItemCat(ItemCat itemCat);
    @Delete("delete from item_cat where id=#{id}")
    void deleteItemCat(Integer id);

    @Delete("delete from item_cat where id=#{id} or parent_id=#{id}")
    void deleteItemCat2(Integer id);

    void deleteItemCat3(Integer id);
    void saveItemCat(ItemCat itemCat);








}
